/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */
#ifndef _FR_UDPFROMTO_H
#define _FR_UDPFROMTO_H
/**
 * $Id: a07f4e537bb625672a0e803afdb714f15d0987f3 $
 *
 * @file include/udpfromto.h
 * @brief Abstract API for sending and receiving packets on unconnected UDP sockets.
 *
 * @copyright 2015  The FreeRADIUS server project
 */
RCSIDH(udpfromto_h, "$Id: a07f4e537bb625672a0e803afdb714f15d0987f3 $")

#include <freeradius-devel/libradius.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifdef WITH_UDPFROMTO
int udpfromto_init(int s);
int recvfromto(int s, void *buf, size_t len, int flags,
	       struct sockaddr *from, socklen_t *fromlen,
	       struct sockaddr *to, socklen_t *tolen,
	       int *if_index, struct timeval *when);
int sendfromto(int s, void *buf, size_t len, int flags,
	       struct sockaddr *from, socklen_t fromlen,
	       struct sockaddr *to, socklen_t tolen,
	       int if_index);
#endif

#ifdef __cplusplus
}
#endif
#endif /* _FR_UDPFROMTO_H */
